package cn.com.device.monitor.mqtt;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.messaging.MessageChannel;
import org.springframework.messaging.support.MessageBuilder;
import org.springframework.stereotype.Service;

/**
 * 生产消息
 */
@Service
public class MqttMessageSender {

    @Autowired
    private MessageChannel mqttOutboundChannel;

    public void sendMessage(String payload) {
        mqttOutboundChannel.send(MessageBuilder.withPayload(payload).build());
    }
}